package cn.gok;

interface Fly{
    void  fly();


}
interface Callable{
    void call();
}
class Plane implements Fly{

    @Override
    public void fly() {
        System.out.println("飞机在飞");
    }
}
class Bird implements Fly,Callable{

    @Override
    public void fly() {
        System.out.println("鸟在飞");

    }

    @Override
    public void call() {
        System.out.println("鸟在叫");

    }
}
public class 接口 {
    public static void main(String[] args) {
//        Fly f=new Fly() ;//无法实例化
//        Plane plane =new Plane();
//        plane.fly();
        //方法2，接口声明，用实现类来实例化
        Fly f =new Plane();
        f.fly();
        Bird bird =new Bird();
        bird.call();
        bird.fly();

    }
}
